Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rendering transform of Y-sorted branch-root #90749

Merged

Conversation

kleonc
Copy link
Member

@kleonc kleonc commented Apr 16, 2024

Fixes #90739.

When Y-sorting a branch like:

 ┖╴A (y_sort_enabled = false)
    ┖╴B (y_sort_enabled = true)
       ┖╴C (y_sort_enabled = true)
          ┖╴D (y_sort_enabled = whatever)

it is flattened like:

 ┖╴A
    ┖╴B
       ┠╴B_copy
       ┠╴C
       ┖╴D

where B_copy, C, D are ordered/sorted according to their Y position within B's coordinate space.

The issue was B_copy.ysort_xform was set to inverse of B's final transform, hence B_copy would always end up being rendered at B's xform_curr as the whole final transform would be cancelled out (and because in RendererCanvasCull::_cull_canvas_item called for B_copy the B's xform_curr would be applied again). What needs to be cancelled out is only B's xform_curr.

@kleonc kleonc added this to the 4.3 milestone Apr 16, 2024
@kleonc kleonc requested a review from a team as a code owner April 16, 2024 12:28
@kleonc kleonc changed the title Fix transform of Y-sorted branch-root Fix rendering transform of Y-sorted branch-root Apr 16, 2024
Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me. This essentially reverts this line back to what it was before 2D interpolation.

Would be good to have @rburing's thoughts too

Copy link
Member

@rburing rburing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@akien-mga akien-mga merged commit ce13f0c into godotengine:master Apr 17, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@kleonc kleonc deleted the y-sort-branch-root-transform-fix branch April 17, 2024 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Y-sort doesn't work properly
4 participants